home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
dev
/
amos
/
amos_col.lha
/
AMOS-COL
/
3D_CUBE.amos
/
3D_CUBE.amosSourceCode
Wrap
AMOS Source Code
|
1980-01-10
|
2KB
|
93 lines
'By Delta/Opium
'
'�ukasz �elezny
'ul. W�oska 4D/6
'42-612 Tarnowskie G�ry
'Poland
'
'Date: 05.1997
'
'REAL TIME!!!!
'
Cls 0
Dim XR#(8),YR#(8),ZR#(8),ZR2#(8)
XM=319
YM=199
Read XO#,YO#,ZO#
For K=1 To 8
Read XR#(K),YR#(K),ZR#(K)
If XR#(K)<0 or XR#(K)>XM or YR#(K)<0 or YR#(K)>YM Then End
Next K
Screen Open 0,320,256,8,Lowres
Curs Off : Flash Off : Cls 0 : Palette $0,$90,$A0,$B0,$C0,$D0,$E0,$F0
Double Buffer : Autoback 0
_START:
X#=(X#-4)*(Pi#/180)
Y#=(Y#+1)*(Pi#/180)
Z#=(Z#+2)*(Pi#/180)
If X#=>360 Then End
For K=1 To 8
YS#=YR#(K)
YR#(K)=YO#+(YR#(K)-YO#)*Cos(X#)+(ZR#(K)-ZO#)*Sin(X#)
ZR#(K)=ZO#+(ZR#(K)-ZO#)*Cos(X#)-(YS#-YO#)*Sin(X#)
Next
For K=1 To 8
XS#=XR#(K)
XR#(K)=XO#+(XR#(K)-XO#)*Cos(Y#)-(ZR#(K)-ZO#)*Sin(Y#)
ZR#(K)=ZO#+(ZR#(K)-ZO#)*Cos(Y#)+(XS#-XO#)*Sin(Y#)
Next
For K=1 To 8
XS#=XR#(K)
XR#(K)=XO#+(XR#(K)-XO#)*Cos(Z#)+(YR#(K)-YO#)*Sin(Z#)
YR#(K)=YO#+(YR#(K)-YO#)*Cos(Z#)-(XS#-XO#)*Sin(Z#)
Next K
Gosub RYSUJ
Goto _START
RYSUJ:
Locate 1,1
For G=1 To 8
ZR2#(G)=ZR#(G)
Next
Sort ZR2#(0)
KOL=144
Locate 1,1
Screen Swap
Cls 0
If ZR#(1)=ZR#(5) Then 680
If ZR#(1)>ZR#(5) Then 610
Ink 2 : Polygon XR#(1),YR#(1) To XR#(2),YR#(2) To XR#(3),YR#(3) To XR#(4),YR#(4) To XR#(1),YR#(1)
Goto 680
610
Ink 3 : Polygon XR#(5),YR#(5) To XR#(6),YR#(6) To XR#(7),YR#(7) To XR#(8),YR#(8) To XR#(5),YR#(5)
680 If ZR#(1)=ZR#(4) Then 860
If ZR#(1)>ZR#(4) Then 790
Ink 4 : Polygon XR#(1),YR#(1) To XR#(2),YR#(2) To XR#(6),YR#(6) To XR#(5),YR#(5) To XR#(1),YR#(1)
Goto 860
'
790
Ink 5 : Polygon XR#(4),YR#(4) To XR#(3),YR#(3) To XR#(7),YR#(7) To XR#(8),YR#(8) To XR#(4),YR#(4)
860 If ZR#(1)=ZR#(2) Then Return
If ZR#(1)>ZR#(2) Then 970
Ink 6 : Polygon XR#(1),YR#(1) To XR#(4),YR#(4) To XR#(8),YR#(8) To XR#(5),YR#(5) To XR#(1),YR#(1)
Return
970
Ink 7 : Polygon XR#(2),YR#(2) To XR#(3),YR#(3) To XR#(7),YR#(7) To XR#(6),YR#(6) To XR#(2),YR#(2)
Return
'
Data 140,80,124
Data 164,56,100,164,104,100,116,104,100,116,56,100
Data 164,56,148,164,104,148,116,104,148,116,56,148
1150 End